{temp('admin/head')}
<!-- 以下是art弹窗js -->
<script src="{$adstyle}/js/art/artDialog.source.js?skin=opera"></script>
<script src="{$adstyle}/js/art/plugins/iframeTools.source.js"></script>

</head>
<style>
/*兼职时间样式*/
.icheck{
	margin: 7px 0;
}
.icheck i{
	display: inline-block; 
	width:9px; 
	height: 12px; 
	background:url(http://pic2.58.com/ui7/job/hire/pt-job.png) 0 -83px no-repeat;
}
.icheck th,.icheck td{ 
	width: 50px; 
	line-height:24px; 
	font-weight:normal;
	font-size:12px; 
	border: 1px solid #d9d9d9; 
	text-align: center; 
	color: #585858;
}
.icheck th{
	background: #f4f4f4;
}
</style>
<body class="page-body">
		
		{temp('admin/left')}
			
			{temp('admin/top')}
			
			{if(@$rs['id'])}
			<div class="row">
				<div class="col-sm-12">
					
					<div class="panel panel-default">
						<div class="panel-heading">
							<h3 class="panel-title">{$tit}</h3>
						</div>
						<div class="panel-body">
							
							<form role="form" class="form-horizontal">
								<div class="form-group">
									<label class="col-sm-2 control-label" for="qy_name">企业名称</label>
									<div class="col-sm-10">
										<div class="form-control" id="qy_name" style="border:0px"> {if(@$rs['qy_name'])}{$rs['qy_name']}{/if}</div>
									</div>
								</div>
								<div class="form-group-separator"></div>
								
								<div class="form-group">
									<label class="col-sm-2 control-label" for="qy_xz">企业性质</label>
									<div class="col-sm-10">
										<div class="form-control" id="qy_xz" style="border:0px"> {if(@$rs['qyxz'])}{$rs['qyxz']}{/if}</div>
									</div>
								</div>
								<div class="form-group-separator"></div>
								
								<div class="form-group">
									<label class="col-sm-2 control-label" for="zt">职位类型</label>
									<div class="col-sm-10">
										<div class="form-control" id="zt" style="border:0px"> {if(@$rs['zt'] == 1)}兼职{else}全职{/if}</div>
									</div>
								</div>
								<div class="form-group-separator"></div>
								
								<div class="form-group">
									<label class="col-sm-2 control-label" for="name">岗位名称</label>
									<div class="col-sm-10">
										<input type="text" class="form-control" id="name" value="{if(@$rs['name'])}{$rs['name']}{/if}">
									</div>
								</div>
								<div class="form-group-separator"></div>
								
								<div class="form-group">
									<label class="col-sm-2 control-label" for="number">招聘人数</label>
									<div class="col-sm-10">
										<input type="text" class="form-control" id="number" value="{if(@$rs['number'])}{$rs['number']}{/if}">
									</div>
								</div>
								<div class="form-group-separator"></div>
								
								<div class="form-group">
									<label class="col-sm-2 control-label" for="sshy">所属行业</label>
									<div class="col-sm-10">
										<select class="form-control" id="sshy">
						        			<option value="0">请选择</option>
						        			{if(@$hangye)}
						        			{foreach($hangye as $k=>$v)}
						        			<option {if(@$rs['sshy'] == $v['id'])}selected="selected"{/if} value="{$v['id']}">{$v['name']}</option>
						        			{/foreach}
						        			{/if}
						        		</select>
									</div>
								</div>
								<div class="form-group-separator"></div>
											
								<div class="form-group">
									<label class="col-sm-2 control-label" for="zwlb">职位类别</label>
									<div class="col-sm-10">
										<select class="form-control" id="zwlb">
						        			<option value="0">请选择</option>
						        			{if(@$zhiwei)}
						        			{foreach($zhiwei as $k=>$v)}
						        			<option {if(@$rs['zwlb'] == $v['id'])}selected="selected"{/if} value="{$v['id']}">{$v['name']}</option>
						        			{/foreach}
						        			{/if}
						        		</select>
									</div>
								</div>
								<div class="form-group-separator"></div>
								
								<div class="form-group">
									<label class="col-sm-2 control-label" for="money">薪资</label>
									<div class="col-sm-10">
										<select class="form-control" id="money">
						        			{if(@$_xz)}
						        			{foreach($_xz as $k=>$v)}
						        			<option {if(@$rs['money'] == $v)}selected="selected"{/if} value="{$v}">{$v}</option>
						        			{/foreach}
						        			{/if}
						        		</select>
									</div>
								</div>
								<div class="form-group-separator"></div>
								
								<div class="form-group">
									<label class="col-sm-2 control-label" for="kstime">招聘开始时间</label>
									<div class="col-sm-10">
										<input type="text" class="form-control datepicker" id="kstime" value="{if(@$rs['kstime'])}{code(echo date('Y-m-d',$rs['kstime']))}{/if}" data-format="yyyy-mm-dd" data-start-date="" data-end-date="-1d">
									</div>
								</div>
								<div class="form-group-separator"></div>
								
								<div class="form-group">
									<label class="col-sm-2 control-label" for="jstime">招聘结束时间</label>
									<div class="col-sm-10">
										<input type="text" class="form-control datepicker" id="jstime" value="{if(@$rs['jstime'])}{code(echo date('Y-m-d',$rs['jstime']))}{/if}" data-format="yyyy-mm-dd" data-start-date="" data-end-date="-1d">
									</div>
								</div>
								<div class="form-group-separator"></div>
								
								<div class="form-group">
									<label class="col-sm-2 control-label">工作地点</label>
									<div class="col-sm-10">
										<div class="col-sm-2">
										<select class="form-control" id="sheng" onchange="gbdz(this.value,'shi','qu')">
											<option value="0">请选择</option>
						        			{if(@$sh)}
						        			{foreach($sh as $k=>$v)}
						        			<option {if(@$rs['sheng'] == $v['area_id'])}selected="selected"{/if} value="{$v['area_id']}">{$v['area_name']}</option>
						        			{/foreach}
						        			{/if}
										</select>
										</div>
										<div class="col-sm-2">
						        		<select class="form-control" id="shi" onchange="gbdz(this.value,'qu','')">
						        			<option value="0">请选择</option>
						        			{if(@$shi)}
						        			{foreach($shi as $k=>$v)}
						        			<option {if(@$rs['shi'] == $v['area_id'])}selected="selected"{/if} value="{$v['area_id']}">{$v['area_name']}</option>
						        			{/foreach}
						        			{/if}
						        		</select>
						        		</div>
						        		<div class="col-sm-2">
						        		<select class="form-control" id="qu">
						        			<option value="0">请选择</option>
						        			{if(@$qu)}
						        			{foreach($qu as $k=>$v)}
						        			<option {if(@$rs['qu'] == $v['area_id'])}selected="selected"{/if} value="{$v['area_id']}">{$v['area_name']}</option>
						        			{/foreach}
						        			{/if}
						        		</select>
						        		</div>
						        		<div class="col-sm-4">
                                    	<input type="text" class="form-control" id="address" value="{if(@$rs['address'])}{$rs['address']}{/if}"/>
										</div>
									</div>
								</div>
								<div class="form-group-separator"></div>
								
								<div class="form-group">
									<label class="col-sm-2 control-label" for="linkman">联系人</label>
									<div class="col-sm-10">
										<input type="text" class="form-control" id="linkman" value="{if(@$rs['linkman'])}{$rs['linkman']}{/if}">
									</div>
								</div>
								<div class="form-group-separator"></div>
								
								<div class="form-group">
									<label class="col-sm-2 control-label" for="phone">手机号</label>
									<div class="col-sm-10">
										<input type="text" class="form-control" id="phone" value="{if(@$rs['phone'])}{$rs['phone']}{/if}">
									</div>
								</div>
								<div class="form-group-separator"></div>
								
								<div class="form-group">
									<label class="col-sm-2 control-label" for="email">投递邮箱</label>
									<div class="col-sm-10">
										<input type="text" class="form-control" id="email" value="{if(@$rs['email'])}{$rs['email']}{/if}">
									</div>
								</div>
								<div class="form-group-separator"></div>
								{if($rs['zt'] == 0)}
								<div class="form-group">
									<label class="col-sm-2 control-label" for="stay">是否提供住宿</label>
									<div class="col-sm-10">
										<div class="radio">
											<label>
												<input type="radio" name="stay" value="1" {if(@$rs['stay'] != 2)}checked{/if}>
												是
											</label>
										</div>
										<div class="radio">
											<label>
												<input type="radio" name="stay" value="2" {if(@$rs['stay'] == 2)}checked{/if}>
												否
											</label>
										</div>
									</div>
								</div>
								<div class="form-group-separator"></div>
								{/if}
								<div class="form-group">
									<label class="col-sm-2 control-label" for="issue">是否发布</label>
									<div class="col-sm-10">
										<div class="radio">
											<label>
												<input type="radio" name="issue" value="1" {if(@$rs['issue'] != 2)}checked{/if}>
												是
											</label>
										</div>
										<div class="radio">
											<label>
												<input type="radio" name="issue" value="2" {if(@$rs['issue'] == 2)}checked{/if}>
												否
											</label>
										</div>
									</div>
								</div>
								<div class="form-group-separator"></div>
								
								<h3>任职要求：</h3>
								
								
								<div class="form-group">
									<label class="col-sm-2 control-label" for="sex">性别</label>
									<div class="col-sm-10">
										<div class="radio">
											<label>
												<input type="radio" name="sex" value="男" {if(@$rs['sex'] == '男')}checked{/if}>
												男
											</label>
										</div>
										<div class="radio">
											<label>
												<input type="radio" name="sex" value="女" {if(@$rs['sex'] == '女')}checked{/if}>
												女
											</label>
										</div>
										<div class="radio">
											<label>
												<input type="radio" name="sex" value="不限" {if(@$rs['sex'] == '不限')}checked{/if}>
												不限
											</label>
										</div>
									</div>
								</div>
								<div class="form-group-separator"></div>
								
								<div class="form-group">
									<label class="col-sm-2 control-label" for="age">年龄</label>
									<div class="col-sm-10">
										<input type="text" class="form-control" id="age" value="{if(@$rs['age'])}{$rs['age']}{else}0{/if}">
										<span>* 0表示不受限制</span>
									</div>
								</div>
								<div class="form-group-separator"></div>
								
								<div class="form-group">
									<label class="col-sm-2 control-label" for="height">身高</label>
									<div class="col-sm-10">
										<input type="text" class="form-control"  id="height" value="{if(@$rs['height'])}{$rs['height']}{else}0{/if}">
										<span>* 单位cm 0表示不受限制</span>
									</div>
								</div>
								<div class="form-group-separator"></div>
								{if($rs['zt'] == 0)}
								<div class="form-group">
									<label class="col-sm-2 control-label" for="gzjy">工作经验</label>
									<div class="col-sm-10">
										<select class="form-control" id="gzjy">
						        			{if(@$_gzjy)}
						        			{foreach($_gzjy as $k=>$v)}
						        			<option {if(@$rs['gzjy'] == $v)}selected="selected"{/if} value="{$v}">{$v}</option>
						        			{/foreach}
						        			{/if}
						        		</select>
									</div>
								</div>
								<div class="form-group-separator"></div>
								
								<div class="form-group">
									<label class="col-sm-2 control-label" for="xueli">学历</label>
									<div class="col-sm-10">
										{if(@$_xueli)}
										<select class="form-control" id="xueli">
						        			{foreach($_xueli as $k=>$v)}
						        			<option {if(@$rs['xueli'] == $v)}selected="selected"{/if} value="{$v}">{$v}</option>
						        			{/foreach}
						        		</select>
						        		{/if}
									</div>
								</div>
								<div class="form-group-separator"></div>
								
								<div class="form-group">
									<label class="col-sm-2 control-label" for=language>外语语种</label>
									<div class="col-sm-10">
										<select class="form-control" id="language">
						        			{if(@$_waiyu)}
						        			{foreach($_waiyu as $k=>$v)}
						        			<option {if(@$rs['language'] == $v)}selected="selected"{/if} value="{$v}">{$v}</option>
						        			{/foreach}
						        			{/if}
						        		</select>
									</div>
								</div>
								<div class="form-group-separator"></div>
								
								<div class="form-group">
									<label class="col-sm-2 control-label" for="langpro">语言水平</label>
									<div class="col-sm-10">
										<select class="form-control" id="langpro">
						        			{if(@$_yysp)}
						        			{foreach($_yysp as $k=>$v)}
						        			<option {if(@$rs['langpro'] == $v)}selected="selected"{/if} value="{$v}">{$v}</option>
						        			{/foreach}
						        			{/if}
						        		</select>
									</div>
								</div>
								<div class="form-group-separator"></div>
								
								<div class="form-group">
									<label class="col-sm-2 control-label" for="cskill">计算机水平</label>
									<div class="col-sm-10">
										<select class="form-control" id="cskill">
						        			{if(@$_cskill)}
						        			{foreach($_cskill as $k=>$v)}
						        			<option {if(@$rs['cskill'] == $v)}selected="selected"{/if} value="{$v}">{$v}</option>
						        			{/foreach}
						        			{/if}
						        		</select>
									</div>
								</div>
								<div class="form-group-separator"></div>

								{else}
								<div class="form-group">
									<label class="col-sm-2 control-label" for="jztime">兼职时间</label>
									<div class="col-sm-10">
										<table class="icheck">
                                    		<thead>
                                    			<tr>
                                    				<th>&nbsp;</th>
                                    				<th>星期一</th>
                                    				<th>星期二</th>
                                    				<th>星期三</th>
                                    				<th>星期四</th>
                                    				<th>星期五</th>
                                    				<th>星期六</th>
                                    				<th>星期日</th>
                                    			</tr>
                                    		</thead>
                                    		<tbody>
                                    			<tr>
                                    				<th>上午</th>
                                    				<td><input type="checkbox" {if(strpos($rs['jztime'],',1_1,') !== false)}checked="checked"{/if} name="jztime" id="chk_1_1" value="1_1" /></td>
                                    				<td><input type="checkbox" {if(strpos($rs['jztime'],',2_1,') !== false)}checked="checked"{/if} name="jztime" id="chk_2_1" value="2_1" /></td>
                                    				<td><input type="checkbox" {if(strpos($rs['jztime'],',3_1,') !== false)}checked="checked"{/if} name="jztime" id="chk_3_1" value="3_1" /></td>
                                    				<td><input type="checkbox" {if(strpos($rs['jztime'],',4_1,') !== false)}checked="checked"{/if} name="jztime" id="chk_4_1" value="4_1" /></td>
                                    				<td><input type="checkbox" {if(strpos($rs['jztime'],',5_1,') !== false)}checked="checked"{/if} name="jztime" id="chk_5_1" value="5_1" /></td>
                                    				<td><input type="checkbox" {if(strpos($rs['jztime'],',6_1,') !== false)}checked="checked"{/if} name="jztime" id="chk_6_1" value="6_1" /></td>
                                    				<td><input type="checkbox" {if(strpos($rs['jztime'],',7_1,') !== false)}checked="checked"{/if} name="jztime" id="chk_7_1" value="7_1" /></td>
                                    			</tr>
                                    			<tr>
                                    				<th>下午</th>
                                    				<td><input type="checkbox" {if(strpos($rs['jztime'],',1_2,') !== false)}checked="checked"{/if} name="jztime" id="chk_1_2" value="1_2" /></td>
                                    				<td><input type="checkbox" {if(strpos($rs['jztime'],',2_2,') !== false)}checked="checked"{/if} name="jztime" id="chk_2_2" value="2_2" /></td>
                                    				<td><input type="checkbox" {if(strpos($rs['jztime'],',3_2,') !== false)}checked="checked"{/if} name="jztime" id="chk_3_2" value="3_2" /></td>
                                    				<td><input type="checkbox" {if(strpos($rs['jztime'],',4_2,') !== false)}checked="checked"{/if} name="jztime" id="chk_4_2" value="4_2" /></td>
                                    				<td><input type="checkbox" {if(strpos($rs['jztime'],',5_2,') !== false)}checked="checked"{/if} name="jztime" id="chk_5_2" value="5_2" /></td>
                                    				<td><input type="checkbox" {if(strpos($rs['jztime'],',6_2,') !== false)}checked="checked"{/if} name="jztime" id="chk_6_2" value="6_2" /></td>
                                    				<td><input type="checkbox" {if(strpos($rs['jztime'],',7_2,') !== false)}checked="checked"{/if} name="jztime" id="chk_7_2" value="7_2" /></td>
                                    			</tr>
                                    			<tr>
                                    				<th>晚上</th>
                                    				<td><input type="checkbox" {if(strpos($rs['jztime'],',1_3,') !== false)}checked="checked"{/if} name="jztime" id="chk_1_3" value="1_3" /></td>
                                    				<td><input type="checkbox" {if(strpos($rs['jztime'],',2_3,') !== false)}checked="checked"{/if} name="jztime" id="chk_2_3" value="2_3" /></td>
                                    				<td><input type="checkbox" {if(strpos($rs['jztime'],',3_3,') !== false)}checked="checked"{/if} name="jztime" id="chk_3_3" value="3_3" /></td>
                                    				<td><input type="checkbox" {if(strpos($rs['jztime'],',4_3,') !== false)}checked="checked"{/if} name="jztime" id="chk_4_3" value="4_3" /></td>
                                    				<td><input type="checkbox" {if(strpos($rs['jztime'],',5_3,') !== false)}checked="checked"{/if} name="jztime" id="chk_5_3" value="5_3" /></td>
                                    				<td><input type="checkbox" {if(strpos($rs['jztime'],',6_3,') !== false)}checked="checked"{/if} name="jztime" id="chk_6_3" value="6_3" /></td>
                                    				<td><input type="checkbox" {if(strpos($rs['jztime'],',7_3,') !== false)}checked="checked"{/if} name="jztime" id="chk_7_3" value="7_3" /></td>
                                    			</tr>
                                    		</tbody>
                                    	</table>
									</div>
								</div>
								{/if}
								<div class="form-group">
									<label class="col-sm-2 control-label" for="other">{if($rs['zt'] == 1)}工作内容 {else}具体要求{/if}</label>
									<div class="col-sm-10">
									
										<textarea  class="form-control"  id="other">{if(@$rs['other'])}{$rs['other']}{/if}</textarea>
									</div>
								</div>
								<div class="form-group-separator"></div>
								
								
								<div class="form-group">
									<div class="col-sm-10">
										<a href="{$_url}/admin/?act=recruit&met=firm_zw{$gnpd}" class="btn btn-secondary btn-single pull-right" style="margin-left:10px;">返回</a>
										<button class="btn btn-info btn-single pull-right" onClick="tijiao()" type="button">保存</button>
									</div>
								</div>
							</form>
							
						</div>
					</div>
					
				</div>
			</div>
			{/if}
			
			<script>
			function gbdz(id,nn,cc){//改变地址
				$.post('{$_url}/admin/?act=get_diqu',{id:id},function(data){
					$("#"+nn).html(data);
					if(cc != ''){
						$("#"+cc).html('<option value="0">请选择</option>');
					}
				});
			}
			
			function tijiao(){
				var name = $("#name").val();
				var sshy = $("#sshy").val();
				var number = $("#number").val();
				var money = $("#money").val();
				var sheng = $("#sheng").val();
				var shi = $("#shi").val();
				var qu = $("#qu").val();
				var address = $("#address").val();
				var kstime = $("#kstime").val();
				var jstime = $("#jstime").val();
				var other = $("#other").val();
				var phone = $("#phone").val();
				var email = $("#email").val();
				var xueli = $("#xueli").val();
				var sex = $('input:radio[name=sex]:checked').val();
				var height = $("#height").val();
				var language = $("#language").val();
				var langpro = $("#langpro").val();
				var cskill = $("#cskill").val();
				var gzjy = $("#gzjy").val();
				var linkman = $("#linkman").val();
				var age = $("#age").val();
				var zwlb = $("#zwlb").val();
				var stay = $('input:radio[name=stay]:checked').val();
				var issue = $('input:radio[name=issue]:checked').val();
				{if($rs['zt'] == 1)}
				var check = $('input:checkbox[name="jztime"]:checked');
				var jztime = ',';
				check.each(function(i){
					jztime += this.value + ',';
				});
				if(jztime == ','){
					jztime = '';
				}
				{else}
					jztime = '';
				{/if}
				$.post('{$_url}/admin/?act=recruit&met=zjia_gwbj{$gnpd}',{id:{$rs['id']},qid:{$rs['qid']},
					name:name,sshy:sshy,sex:sex,number:number,money:money,sheng:sheng,shi:shi,qu:qu,
					address:address,kstime:kstime,jstime:jstime,other:other,phone:phone,email:email,xueli:xueli,height:height,
					language:language,langpro:langpro,cskill:cskill,gzjy:gzjy,linkman:linkman,age:age,zwlb:zwlb,
					stay:stay,issue:issue,jztime:jztime},function(data){
						alert(data);
				});
			}

			</script>
			
		{temp('admin/foot')}
	
	<!-- Modal 7 (Ajax Modal)-->
	<div class="modal fade" id="modal-7">
		<div class="modal-dialog">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
					<h4 class="modal-title">{$tit}</h4>
				</div>
				<div class="modal-body">
					Content is loading...
				</div>
				<div class="modal-footer">
					<button type="button" class="btn btn-info" data-dismiss="modal" id="queding">确定</button>
				</div>
			</div>
		</div>
	</div>
	
	<!-- Bottom Scripts -->
	<script src="{$adstyle}/js/bootstrap.min.js"></script>
	<script src="{$adstyle}/js/TweenMax.min.js"></script>
	<script src="{$adstyle}/js/resizeable.js"></script>
	<script src="{$adstyle}/js/joinable.js"></script>
	<script src="{$adstyle}/js/xenon-api.js"></script>
	<script src="{$adstyle}/js/xenon-toggles.js"></script>

	<!-- Imported scripts on this page -->
	<script src="{$adstyle}/js/datepicker/bootstrap-datepicker.js"></script>

	<!-- JavaScripts initializations and stuff -->
	<script src="{$adstyle}/js/xenon-custom.js"></script>

</body>
</html>